package com.zqh.usersave.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zqh.myfmmall.entity.Users;
import com.zqh.myfmmall.result.Result;
import com.zqh.myfmmall.utils.Md5Utile;
import com.zqh.usersave.dao.UsersSaveDao;
import com.zqh.usersave.service.UserSaveService;
import org.springframework.stereotype.Service;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-02-18 2:19
 */
@Service("userSaveService")
public class UserSaveServiceImpl extends ServiceImpl<UsersSaveDao, Users> implements UserSaveService{
    @Override
    public Result saveUser(Users user) {
        user.setPassword(Md5Utile.MD5Encode(user.getPassword()));
        return save(user) ? Result.success(null) : Result.internalServerError("服务器开小差了，请重试");
    }
}
